Skip to content

Conversation

souvikghosh04
Copy link
Contributor

@souvikghosh04 souvikghosh04 commented Sep 9, 2025

Why make this change?

  • The linked issue proposes integrating an MCP (Model Context Protocol) server so AI/agent tooling (e.g., VS Code / Copilot–style agents) can introspect the configured data model and perform safe, structured operations against DAB-managed data sources.
  • This enables richer developer tooling, lowers friction for exploratory data access, and creates a foundation for future AI-assisted authoring and governance scenarios.

What is this change?

Introduces an MCP service layer that exposes:

Schema / entity metadata derived from the existing DAB configuration (tables, stored procedures, relationships, GraphQL entity projections).
Operation capabilities (read / create / update / delete) aligned with DAB authorization rules.
A capability negotiation / handshake endpoint so MCP clients can discover features.

MCP endpoint can be accessed with /mcp

Sample request to discover tools-

POST: http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/list"
}

How was this tested?

The working of the MCP endpoint and the describe-entities tool is tested manually in the local environment.

  • Enable MCP in dab-config.json
    "mcp": { "enabled": true, "path": "/mcp", "dml-tools": { "describe-entities": true } }

  • The server was started locally and confirmed to be listening on http://localhost:5000.

  • Send a POST request to the MCP endpoint, http://localhost:5000/mcp

  • Use the Sample Requests shared for the body of the request.

  • The tools/list request successfully returned all registered tools, confirming that the MCP server and tool registry were initialized correctly.

  • The tools/call request for describe-entities returned the expected entity metadata.

Sample Request(s)

  1. Listing all tools available.
    { "jsonrpc": "2.0", "id": "1", "method": "tools/list", "params": {} }

  2. Use the describe-entities tool
    { "jsonrpc": "2.0", "id": "1", "method": "tools/call", "params": { "name": "describe-entities" } }

Jerry Nixon and others added 17 commits August 27, 2025 15:06
This reverts commit 04b19f9, reversing
changes made to 3948822.
…a-api-builder into jerry-mcp-core"

This reverts commit 0b649dbbc877a8ad009ac31eb4a082664d49bce3, reversing
changes made to 2240172.
## Why make this change?

- Introduces a dedicated runtime layer for MCP

## What is this change?

- Adds a runtime initialization module that centralizes configuration
load, validation, DI registration, and service/materialization order.
- Refactors existing startup code into clearer phases; removes
duplicated wiring.
- Improves logging structure and prepares for future feature flags /
layered config overrides.
- Cleans up deprecated code paths (overall net +901 / −130 LOC).
- No intentional breaking changes (verify before merge).

## How was this tested?

- [ ] Integration Tests
- [ ] Unit Tests

## Sample Request(s)

- Discover tools: POST `http://localhost:5000/mcp`

JSON body

```
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/list",
  "params": {}
}
```

- List entities: POST `http://localhost:5000/mcp`

JSON body

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_entities"
  }
}
```

---------

Co-authored-by: Rahul Nishant <[email protected]>
Co-authored-by: RubenCerna2079 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Aniruddh Munde <[email protected]>
@souvikghosh04 souvikghosh04 changed the title Jerry mcp core Adding MCP capability in DAB Sep 9, 2025
@souvikghosh04
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@RubenCerna2079
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates Model Context Protocol (MCP) capability into the Data API Builder (DAB), enabling AI/agent tooling to introspect the configured data model and perform structured operations against DAB-managed data sources.

  • Adds a new MCP service layer that exposes schema/entity metadata and operation capabilities
  • Introduces MCP runtime configuration options with DML tools support
  • Provides endpoint mapping at /mcp path for MCP client interactions

Reviewed Changes

Copilot reviewed 108 out of 110 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/Service/Startup.cs Registers MCP services and maps MCP endpoint
src/Config/ObjectModel/McpRuntimeOptions.cs Defines MCP configuration structure
src/Config/ObjectModel/DmlToolsConfig.cs Configures DML tool availability
src/Azure.DataApiBuilder.Mcp/ New MCP implementation with built-in tools
src/Core/Configurations/RuntimeConfigValidator.cs Validates MCP configuration and path conflicts
Multiple test files Updates test configurations to include MCP options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RubenCerna2079
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25
Copy link
Collaborator

            HttpStatusCode mcpResponseCode = await GetMcpResponsePostConfigHydration(client);

Are we not adding this test for now?


Refers to: src/Service.Tests/Configuration/ConfigurationTests.cs:2612 in b3040ad. [](commit_id = b3040ad, deletion_comment = True)

@RubenCerna2079
Copy link
Contributor

            HttpStatusCode mcpResponseCode = await GetMcpResponsePostConfigHydration(client);

Are we not adding this test for now?

Refers to: src/Service.Tests/Configuration/ConfigurationTests.cs:2612 in b3040ad. [](commit_id = b3040ad, deletion_comment = True)

Right now we are not adding this test since we still have not been able to understand the structure of the payload that needs to be passed to the mcp which is causing the test to fail.

@RubenCerna2079
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@RubenCerna2079 RubenCerna2079 enabled auto-merge (squash) September 25, 2025 23:04
@RubenCerna2079
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@RubenCerna2079
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25 Aniruddh25 merged commit a2f779c into main Sep 26, 2025
11 checks passed
@Aniruddh25 Aniruddh25 deleted the jerry-mcp-core branch September 26, 2025 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants